Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]chore: add compileDependencies default value #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SoloJiang
Copy link
Contributor

@SoloJiang SoloJiang commented May 13, 2021

  • compileDependencies 增量用户为 []

@SoloJiang SoloJiang requested a review from imsobear May 13, 2021 09:40
@imsobear
Copy link
Contributor

要不要默认升级到 webpack 5?

@SoloJiang
Copy link
Contributor Author

要不要默认升级到 webpack 5?

还没完全验证过,下周看下吧

@@ -7,5 +7,8 @@
],
"window": {
"title": "Rax App"
},
"builtInLibrary": {
"lib-mtop": false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

外部用户会不会困惑,def 的逻辑是放在 generate 里处理的

@imsobear
Copy link
Contributor

compileDependencies 增量用户为 []

这个是什么背景?

@SoloJiang
Copy link
Contributor Author

compileDependencies 增量用户为 []

这个是什么背景?

对于 Rax 用户而言,全量编译 node_modules 解决的是两个问题:1. 移除其它端的冗余代码,后续会推使用 exports 字段和跨端组件协议来解决这件事;2. 有些依赖是原始代码没有编译过,全量编译依赖始终不是一个推荐的做法,推荐的应该是三方依赖在发布之前就已经编译过

@imsobear
Copy link
Contributor

@SoloJiang 有个背景是现在很多包不规范,预先没编译,这样切换还是有之前的风险在,这个点怎么考虑?开发时有这样的情况给开发者提示下然后让他加到 compileDependencies 里?

@SoloJiang SoloJiang changed the title chore: close lib-mtop chore: add compileDependencies default value May 14, 2021
@SoloJiang
Copy link
Contributor Author

@SoloJiang 有个背景是现在很多包不规范,预先没编译,这样切换还是有之前的风险在,这个点怎么考虑?开发时有这样的情况给开发者提示下然后让他加到 compileDependencies 里?

先 hold 吧,我测试下这个插件能不能在构建时提示:https://github.com/bitjourney/check-es-version-webpack-plugin

@SoloJiang SoloJiang changed the title chore: add compileDependencies default value [WIP]chore: add compileDependencies default value May 14, 2021
@imsobear
Copy link
Contributor

@SoloJiang 这块还是要把策略想好,比如:

  • 项目里提示,可能只能让开发者意识到这个问题,但不一定能推动解决?这时候能自动帮他追加 compileDep 最好(不要改文件)
  • 组件开发时提示(不一定能覆盖到)

短期要规避问题,长期要推进这些包的标准化。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants